<!--{include file='header'}-->

<!--{if $act == 'add' or $act=='edit'}-->
<div class="bodytitle">
  <div class="bodytitleleft"></div>
  <div class="bodytitletxt"><span class="nav">
    <!--{if $act == 'add'}-->
    Add
    <!--{else}-->
    Edit
    <!--{/if}-->
    Downloads</span></div>
  <div style="float:right; margin-right:5px;"  class="bodytitletxt"><a href="javascript:void(0)" onclick="javascript:history.go(-1)">Back</a></div>
</div>
<script language="javascript" src="fck365/fckeditor.js"></script>
<form action="<!--{$admin_file}-->?adm=games&opt=downloads_do" method="post" name="FORM" enctype="multipart/form-data">
<table cellspacing="1" cellpadding="10" border="0" bgcolor="#e2f5bc" align="center" width="96%" style="margin-top: 6px;">



<tr>
  <td class="main_bleft" width="20%">Product Name:</td>
  <td class="main_bright" align="left"><input  type="text" name="ename" size="50" value="<!--{$doc.ename}-->"></td>
 
  </tr>

      
      <tr >
        <td class="main_bleft">Place</td>
        <td class="main_bright" ><input  type="text" name="place" size="20" value="<!--{$doc.place}-->"></td>


        
      </tr>

   <tr>
        <td class="main_bleft">Images</td>
        <td class="main_bright">
		

		<input type="file" name="upfile[]" size="40" />





</td>
      </tr>


 <tr >
        <td class="main_bleft">PATH URL </td>
        <td class="main_bright" ><input  type="text" name="url" size="60" value="<!--{$doc.url}-->"></td>


        
      </tr>

   
      
      
<tr>
  <td colspan="4" class="main_btn"><input name="step" type="hidden" id="setp" value="<!--{$act}-->" />
        <input name="id" type="hidden" id="id" value="<!--{$doc.id}-->" />
        <input type="submit" name="Submit" value="Save" class="btn"/>
        <input type="reset" name="Submit2" value="Reset" class="btn" /></td>
</tr>

</table>
</form>
        
<!--{else}-->

<div class="bodytitle">
  <div class="bodytitleleft"></div>
  <div class="bodytitletxt">Downloads List</div>
  <div style="float:left; margin-left:10px;"  class="bodytitletxt"><a href="<!--{$admin_file}-->?adm=games&opt=downloads&act=add" >add</a></div>
</div>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
  <td><table width='96%' border='0' cellpadding='0' cellspacing='0' align="center" class="tbtitle">
    <tr>
      <td align='center' valign='top'>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr bgcolor="#FFFFFF">
            <td height="4"></td>
          </tr>
        </table>
        

        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr bgcolor="#FFFFFF">
            <td height="4"></td>
          </tr>
        </table>

        <table width="100%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#E2F5BC;">
          <tr class="tr2">
            <td width="15%">No.</td> 
            <td>Image </td>
            <td>File/Software Name </td>

            <td>Place</td>
            <td>Operate</td>
          </tr>
          <!--{foreach from=$docs item=d}-->
          <tr class="listtr" id="tr_<!--{$d.id}-->" >
            <td><!--{$d.id}--></td>
            
            <td align="left"><!--{if $d.image}--><img src="../<!--{$d.image}-->" width="60" height="60"> <!--{/if}-->           &nbsp;</td>
            <td align="left"><!--{$d.ename}-->&nbsp;</td>
            <td ><!--{$d.place}-->&nbsp;</td>
        


            <td><a href="<!--{$admin_file}-->?adm=games&opt=downloads&act=edit&id=<!--{$d.id}-->" ><img src="images/edit.gif" align="absmiddle" alt="<!--{$lang.ico_edit}-->" /></a> <a href="javascript:void(0)" onclick="dodel(<!--{$d.id}-->)"><img src="images/del.gif" align="absmiddle" alt="<!--{$lang.ico_del}-->" /></a> &nbsp; </td>
          </tr>
          <!--{/foreach}-->
        </table>
     
          <!--{$pages}-->
 

<!--{/if}-->

<script language="javascript">


	function goserviceurl(id){
			window.location="<!--{$admin_file}-->?adm=games&opt=downloads&gid="+id;
	}



var url = "?adm=games&opt=gold";
	function getservice(id,sid){
		$.ajax({
			type: "GET",
			url: "admin.php",
			data: "adm=games&opt=getservices&id="+id+"&sid="+sid,
			success: function(msg){     $("#allservice").html(msg);    }
		});
	}


	var curid = '<!--{$doc.id}-->';

  function dodef(path){
	  

		$.ajax({
			type: "GET",
			url: "admin.php",
			data: "adm=games&opt=downloads&act=imgdef&id="+curid+"&path="+path,
			success: function(msg){ if( msg == 1 ) alert("success");   }
		});

  }



  function dodel(id){
	if(confirm('<!--{$lang.conf_del}-->')){
		$.ajax({
			type: "GET",
			url: "admin.php",
			data: "adm=games&opt=downloads&act=dele&id="+id,
			success: function(msg){   if( msg == 1 ) { $("#tr_"+id).hide();alert("<!--{$lang.success_del}-->"); }   }
		});
	}
  }



<!--{if $doc.gid}--> 
getservice(<!--{$doc.gid}-->,<!--{$doc.sid}-->);
<!--{/if}-->
  </script>
  
<!--{include file='footer'}-->
